package com.cec.home.utils

import org.springframework.util.StringUtils

/**
 *
 * @author weiwei.huang
 * @email ihuangweiwei@163.com
 * @date 16/1/13
 */
class PKUtils {

    final static URL = "http://img.oss.hd1905.com/"


    static List<String> buildImgs(List<String> urls) {
        def list = []
        if (!StringUtils.isEmpty(urls)){
            urls.each {
                list << buildImg(it)
            }
        }
        return list
    }

    static String buildImg(String url) {
        if (StringUtils.isEmpty(url)) {
            return ""
        }

        if (url.startsWith("http")) {
            return url
        }
        return URL + url
    }

}
